
<link rel="stylesheet" href="/opebs/css/bootstrap.min.css">
<link rel="stylesheet" href="/opebs/css/bootstrap-select.css">
<script src="/opebs/js/jquery.min.js"></script>
<script src="/opebs/js/bootstrap.min.js"></script>
<script src="/opebs/js/bootstrap-select.js"></script>
<script src="/lib/jquery.form.js"></script>
<script type="text/javascript" src="/lib/layer/2.4/layer.js"></script>

<link rel="stylesheet" href="/opebs/date/css/bootstrap-datetimepicker.min.css">
<script src="/opebs/date/js/bootstrap-datetimepicker.min.js"></script>

<#include "/common/h-ui-base-css.html">
<#include "/common/validation-js.html">
<body>
    <div class="page-container">
        <form action="" method="post" class="form form-horizontal" id="form-project-add">
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>项目编号：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="${project.proId!}" style="background-color: #8eaf84" placeholder=""  readonly>
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>项目名称：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="${project.proName!}" style="background-color: #8eaf84" placeholder=""  readonly >
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>项目类别：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="${project.proCategory!}" style="background-color: #8eaf84" placeholder=""  readonly >
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>项目状态：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="${proState!}"style="background-color: #8eaf84" placeholder=""  readonly >
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>项目所属公司：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="${project.proCompany!}" style="background-color: #8eaf84" placeholder=""  readonly >
                </div>
            </div>

            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">项目负责人：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="${project.proManager!}" id="proManager" name="proManager">
                </div>
            </div>
            <div class="row cl">
                <label class="form-label col-xs-4 col-sm-2">项目立项时间：</label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="input-text" value="${project.proApprovalTime!}" id="proApprovalTime" name="proApprovalTime">
                </div>
            </div>
            <div class="row cl">
                <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                    <button  class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
                </div>
            </div>
            <input type="text" hidden id="proLixiangFlag" name="proLixiangFlag" value="1">
        </form>
    </div>
</body>


<script type="text/javascript">
    $(function(){
        $("#proApprovalTime").datetimepicker({
            format:'yyyy-mm-dd',  //格式  如果只有yyyy-mm-dd那就是0000-00-00
            autoclose:true,//选择后是否自动关闭
            minView:2,//最精准的时间选择为日期  0-分 1-时 2-日 3-月
            language:  'zh-CN', //中文
            weekStart: 1, //一周从星期几开始
            todayBtn:  1,
            autoclose: 1,
            todayHighlight: 1,
            startView: 2,
            forceParse: 0,
            // daysOfWeekDisabled:"1,2,3", //一周的周几不能选 格式为"1,2,3"  数组格式也行
            todayBtn : true,  //在底部是否显示今天
            todayHighlight :true, //今天是否高亮显示
            keyboardNavigation:true, //方向图标改变日期  必须要有img文件夹 里面存放图标
            showMeridian:false,  //是否出现 上下午
            initialDate:new Date()
            //startDate: "2017-01-01" //日期开始时间 也可以是new Date()只能选择以后的时间
        }).on("changeDate",function(){
            var start = $("#start").val();
        });

    });
</script>

<script type="text/javascript">
    $("#form-project-add").validate({
        rules:{
            proManager:{
                required:true
            },
            proApprovalTime:{
                required:true,
            }
        },
        onkeyup:false,
        focusCleanup:true,
        success:"valid",
        submitHandler:function(form){
            var id = ${project.id!}
            $(form).ajaxSubmit({
                type: 'post',
                url: "/project-ins-upd-del/"+id ,
                data :$("form-project-add").serialize(),
                async:false,
                success: function(data){
                    layer.msg('添加成功!',{icon:1,time:1000});
                },
                error: function(XmlHttpRequest, textStatus, errorThrown){
                    layer.msg('error!',{icon:1,time:1000});
                }
            });
            var index = parent.layer.getFrameIndex(window.name);

            var refreshFlag = ${refreshFlag!};
            if(refreshFlag == 0){
                var handler = '/project-list/1/1/20';
                parent.$('#project_table').datagrid('options').url = handler;
                parent.$('#project_table').datagrid('reload');
            } else if(refreshFlag == 1){
                parent.location.reload();
            }
            parent.layer.close(index);
        }
    });
</script>
